package com.zjitc.dao;

import com.zjitc.pojo.User;
import org.apache.ibatis.annotations.Param;

/**
 * Created by lenovo on 2018/4/1.
 */
public interface UserDao {
    int userNameCount(String username);

    User findByUserNameAndPassword(@Param("username") String username, @Param("password") String password);

    int insert(User user);

    int checkUsername(String username);

    int checkEmail(String password);

    String selectQuestionByUsername(String username);

    int checkAnswer(@Param("username") String username, @Param("question") String question, @Param("answer") String answer);

    int updatePasswordByUsername(@Param("username") String username, @Param("passwordNew") String passwordNew);

    int checkPassword(@Param("password") String password, @Param("userId") Integer id);

    int updateByKey(User user);

    int checkEmailByUserId(@Param("email") String email, @Param("userId") Integer userId);

    User selectByKey(Integer id);
}
